package com.huawei.appgallery.foundation.ui.css.adapter.type;

public class CSSPrimitive implements CSSValue {
    private String value;

    public CSSPrimitive(String str) {
        this.value = str;
    }

    public Integer asInt() {
        try {
            return Integer.valueOf(Integer.parseInt(this.value));
        } catch (Exception e) {
            return null;
        }
    }

    public Float asFloat() {
        try {
            return Float.valueOf(Float.parseFloat(this.value));
        } catch (Exception e) {
            return null;
        }
    }

    public String asString() {
        return this.value;
    }
}
